<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
<!--导航栏-->
<div th:fragment="nav">
    <!--蓝色边框  从左上角到右下角的线性渐变-->
<div style="border: 2px; border: 2px solid blue;background-image: linear-gradient(to bottom right,aliceblue, lightskyblue, lightskyblue); ">
    <h1 align="center"> 系统</h1>
    <div style="display:flex; justify-content: space-between;width: 95%; margin-left: auto; margin-right: auto;" >
        <h3><a href="/user/login">首页</a></h3>
        <h3 style="color:brown"  th:if="${session.who==null}">
            未登录</h3>
        <h3 style="color:blue" th:if="${session.who!=null}">
            姓名:<span th:text="${session.who.uname}"/>
        </h3>
        <h3 th:if="session.who!=null" >
            角色:<span th:if="${role}=='stu'">学生</span>
            <span th:if="${role}=='tea'">教师</span>
            <span th:if="${role}=='adm'">教务处</span>
        </h3>
        <h3 style=""><a href="/user/logout">退出</a> </h3>
        <p>&nbsp;</p>
        <span th:if="${session.who!=null}">
            <div style="width: 10vw;height: 10vw">
            <img style="display: flex;justify-content: center;align-items: center;height: 15vh;" th:src="'/user/showimg/'+${session.who.pic}"/>
        </div>
        </span>
    </div>
</div>
</div>
<!--导航栏结束-->
<!--登录和功能菜单-->
<div style="display: flex;justify-content: space-around">
    <!--登录区-->
    <div style="width: 33%;border: 1px solid red">
        <h2>登录</h2>
        <form method="post" action="/user/login">
            <table width="80%">
                <tr>
                    <td>账号</td>
                    <td><input type="text" name="phone"/></td>
                </tr>
                <tr>
                    <td>密码</td>
                    <td><input type="text" name="pwd"/></td>
                </tr>
                <tr>
                    <td>提交</td>
                    <td><input type="submit" value="登录"/></td>
                </tr>
            </table>

        </form>
        <hr>
        登录信息：<span th:text="${loginmsg}"></span>
        <div>
            <h4 th:if="${session.who!=null}">
               姓名：<span th:text="${session.who.uname}"></span>
               手机号：<span th:text="${session.who.phone}"></span>
            </h4>
        </div>
    </div>
    <!--功能区-->
    <div style="width: 66%;border: 1px solid blue">
       <div  th:if="${role}=='adm'">
        <h2>功能</h2>
        <p><a href="/admclz/findAll">班级管理</a></p>
        <p><a href="/adm/findAll">课程管理</a></p>
        <p><a href="/admtea/findAll">教师管理</a></p>
        <p><a href="/admstu/findAll">学生管理</a></p>
        <p><a href="/admtask/findAll">排课管理</a></p>
       </div>
        <div  th:if="${role}=='stu'">
        <h2>学生的功能</h2>
        <p><a href="/stu/find">修改密码</a></p>
        <p><a href="#">修改头像</a></p>
        <p><a href="/stu/findcou">查课程</a></p>
        <p><a href="/stu/findmark">查成绩</a></p>
        </div>
        <div th:if="${role}=='tea'">
        <h2>教师的功能</h2>
        <p><a href="/tea/find">修改密码</a></p>
        <p><a href="">修改头像</a></p>
        <p><a href="/tea/findcourse">登分-难</a></p>
    </div>
    </div>
</div>
</body>
</html>